public class class2 {
    import java.util.ArrayList;
import java.util.List;

    class College {
        // 聚合：建筑
        private List<Building> buildings;
        // 组合：课程
        private List<Course> courses;

        public College() {
            this.buildings = new ArrayList<>();
            this.courses = new ArrayList<>();
        }

        // 添加建筑
        public void addBuilding(Building building) {
            buildings.add(building);
        }

        // 添加课程
        public void addCourse(Course course) {
            courses.add(course);
        }

        // 获取建筑
        public List<Building> getBuildings() {
            return buildings;
        }

        // 获取课程
        public List<Course> getCourses() {
            return courses;
        }
    }

    class Building {
        private String name;

        public Building(String name) {
            this.name = name;
        }

        public String getName() {
            return name;
        }
    }

    class Course {
        private String name;
        private Building building;  // 课程所在的建筑

        public Course(String name, Building building) {
            this.name = name;
            this.building = building;  // 确保课程在特定的建筑中进行
        }

        public String getName() {
            return name;
        }

        public Building getBuilding() {
            return building;
        }
    }
}
